import { _decorator, Component } from "cc";
const { ccclass, property } = _decorator;

@ccclass("UIBullet")
export class UIBullet extends Component {
  @property
  speed: number = 500;
  start() {}

  update(deltaTime: number) {
    const pos = this.node.getPosition();
    this.node.setPosition(pos.x, pos.y + this.speed * deltaTime, pos.z);
    if (pos.y > 440) {
      this.node.destroy();
    }
  }
}
